package engine.graphics.sprite
{
	import away3d.core.managers.*;
	import engine.core.*;
	import engine.graphics.away3d.*;
	import engine.graphics.vfx.*;
	import engine.math.*;
	import engine.graphics.resources.*;
	
	public class RxSprite3D
	{
		protected var m_position:RxVector4;
		protected var m_depthBias:Number;
		protected var m_width:Number;
		protected var m_height:Number;
		protected var m_texcMatrix0:RxMatrix4x4;
		protected var m_texcMatrix1:RxMatrix4x4;
		protected var m_frameBlend:Number;
		protected var m_color:RxVector4;
		protected var m_emissive:Number;
		protected var m_srcBlend:uint;
		protected var m_dstBlend:uint;
		protected var m_blendEnabled:Boolean;
		protected var m_refractionScale:Number;
		protected var m_diffuseMap:RxGPUTexture2D;
		protected var m_refractionMap:RxGPUTexture2D;
		private static var s_pool:RxObjectPool = null;
		
		public function RxSprite3D()
		{
			Init();
		}
		
		public function Init() : void
		{
			if (this.m_position == null)
			{
				this.m_position = new RxVector4();
			}
			this.m_position.Set(0, 0, 0, 1);
			this.m_depthBias = 0;
			this.m_width = 0;
			this.m_height = 0;
			if (this.m_texcMatrix0 == null)
			{
				this.m_texcMatrix0 = new RxMatrix4x4();
			}
			else
			{
				this.m_texcMatrix0.Identity();
			}
			if (this.m_texcMatrix1 == null)
			{
				this.m_texcMatrix1 = new RxMatrix4x4();
			}
			else
			{
				this.m_texcMatrix1.Identity();
			}
			this.m_frameBlend = 0;
			if (this.m_color == null)
			{
				this.m_color = new RxVector4();
			}
			this.m_color.Set(1, 1, 1, 1);
			this.m_emissive = 0;
			this.m_srcBlend = Stage3DProxy.BLEND_FACTOR_SOURCE_ALPHA;
			this.m_dstBlend = Stage3DProxy.BLEND_FACTOR_ONE_MINUS_SOURCE_ALPHA;
			this.m_blendEnabled = true;
			this.m_diffuseMap = null;
			this.m_refractionMap = null;
			this.m_refractionScale = 1;
		}
		
		public static function CreatePool(initSize:uint, growSize:uint) : void
		{
			var allocFunc:* = function () : Object
			{
				return new RxSprite3D();
			};
			s_pool = new RxObjectPool(allocFunc, null, initSize, growSize, RxSprite3D);
		}
	}
}